package com.example.asynctaskdemo;

import android.app.Activity;
import android.view.Gravity;
import android.widget.Toast;

/**
 * Created by hukunge on 2016/6/15.
 * 统一用这个toast，以后方便同意改toast风格
 */
public class ToastUtil {
    public static void shortToast(Activity context,String str) {
        Toast t = Toast.makeText(context, str, Toast.LENGTH_SHORT);
        t.setGravity(Gravity.CENTER, 0, 0);
        t.show();
    }

    public static void longToast(Activity context ,String str) {
        Toast t = Toast.makeText(context, str, Toast.LENGTH_LONG);
        t.setGravity(Gravity.CENTER, 0, 0);
        t.show();
    }
}
